package net.xdclass.service;

import net.xdclass.controller.request.wx.NativeOrderRequest;
import net.xdclass.enums.PayOrderType;
import net.xdclass.model.WxOrderInfoDO;
import net.xdclass.model.WxOrderStatusDO;

import java.util.Map;

/**
 * @author Administrator
 * @description
 * @since 2023-07-02 22:07
 */
public interface WxPayService {

    /**
     * 插入 订单
     *
     * @param nativeOrderRequest
     * @return
     */
    Map<String, Object> insertPrepareOrder(NativeOrderRequest nativeOrderRequest);

    String queryOrderStatusByOutTradeNo(String outTradeNo, String merid);

    /**
     * 根据流水号修改订单状态
     *
     * @param outTradeNo
     * @param merid
     * @param oldStatus
     * @param newStatus
     * @return
     */
    Boolean changeOrderStatusByOutTradeNo(String outTradeNo, String merid, PayOrderType oldStatus, PayOrderType newStatus);

    /**
     * 根据订单id修改订单状态
     * @param orderId
     * @param oldStatus
     * @param newStatus
     * @return
     */
    Boolean changeOrderStatusByOrderId(Long orderId, PayOrderType oldStatus, PayOrderType newStatus);

    Boolean payByOrderId(Long orderId);

}
